
package com.app.hmst.model;

import java.util.List;

import com.roscopeco.ormdroid.Entity;

public class HomestayInfoVO extends Entity{
	public int id;
	public String name;
	public String province;
	public String district;
	public String tumbol;
	public String address;
	public String tel;
	public String mobile;
	public String fax;
	public String email;
	public String website;
	public String contactName;
	public String sumCode;
	public String status;
	public String q1;
	public String q2;
	public String contactPosition;
	public String establish;
	
	
	public HomestayInfoVO(){
		this(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);
	}
	
	public HomestayInfoVO(String name, String province, String district,
			String tumbol, String address, String tel, String mobile,
			String fax, String email, String website, String contactName,
			String sumCode, String status,String q1,String q2,String contactPosition,String establish) {
		this.name = name;
		this.province = province;
		this.district = district;
		this.tumbol = tumbol;
		this.address = address;
		this.tel = tel;
		this.mobile = mobile;
		this.fax = fax;
		this.email = email;
		this.website = website;
		this.contactName = contactName;
		this.sumCode = sumCode;
		this.status = status;
		this.q1 = q1;
		this.q2 = q2;
		this.contactPosition = contactPosition;
		this.establish = establish;
	}
	
	public List<HouseInfoVO> houses() {
		return query(HouseInfoVO.class).where("homestayId").eq(id).executeMulti();
	}
	public boolean isNotEmpty(){
		List<HomestayInfoVO> list = null;
		boolean isNotEmpty = false;
		list = query(HomestayInfoVO.class).executeMulti();
		if(list!=null && !list.isEmpty()){
			isNotEmpty = true ;
		}
		return isNotEmpty;
	}
}
